package com.song.day06.ch6_3;

import java.util.Date;
import java.util.concurrent.LinkedBlockingDeque;

public class TaskMain {
	
	
	public static void main(String[] args) {
		
		LinkedBlockingDeque<String> list = new LinkedBlockingDeque<String>();
		Client client = new Client(list);
		Thread thread = new Thread(client);
		thread.start();
		
		for(int i=0; i<3; i++)
		{
			for( int j =0 ;j< 5;i++)
			{
				try {
					String request  = list.take();
					System.out.printf(" Main : request : %s at %s size %d \n" , request ,new Date(), list.size());
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		
		System.out.printf(" Main :End of the program \n");
	}
}
